load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ranger",
    srcs = [
        "checker.go",
        "detacher.go",
        "points.go",
        "ranger.go",
        "types.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/util/ranger",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/errctx",
        "//pkg/expression",
        "//pkg/kv",
        "//pkg/meta/model",
        "//pkg/parser/ast",
        "//pkg/parser/charset",
        "//pkg/parser/format",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/planner/planctx",
        "//pkg/planner/util/fixcontrol",
        "//pkg/sessionctx/stmtctx",
        "//pkg/types",
        "//pkg/types/parser_driver",
        "//pkg/util/chunk",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "//pkg/util/dbterror/plannererrors",
        "//pkg/util/hack",
        "//pkg/util/intest",
        "//pkg/util/ranger/context",
        "@com_github_pingcap_errors//:errors",
    ],
)

go_test(
    name = "ranger_test",
    timeout = "short",
    srcs = [
        "bench_test.go",
        "main_test.go",
        "ranger_test.go",
        "types_test.go",
    ],
    flaky = True,
    shard_count = 26,
    deps = [
        ":ranger",
        "//pkg/config",
        "//pkg/domain",
        "//pkg/expression",
        "//pkg/expression/exprstatic",
        "//pkg/parser/ast",
        "//pkg/parser/mysql",
        "//pkg/planner/core",
        "//pkg/planner/core/base",
        "//pkg/planner/core/operator/logicalop",
        "//pkg/planner/core/operator/physicalop",
        "//pkg/planner/core/resolve",
        "//pkg/planner/util",
        "//pkg/planner/util/coretestsdk",
        "//pkg/planner/util/utilfuncp",
        "//pkg/session",
        "//pkg/sessionctx",
        "//pkg/testkit",
        "//pkg/testkit/testsetup",
        "//pkg/types",
        "//pkg/util/benchdaily",
        "//pkg/util/collate",
        "//pkg/util/context",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
